package DocCangAPI;

public class SubStringDemo {
    public static void main(String[] args) {
        String name="Thinking in Java";
        String sub=name.substring(5,5+4);
        System.out.println(sub);

        int position=name.lastIndexOf("in");
        System.out.println(position);//9
        position=name.lastIndexOf('n',6);
        System.out.println(position);//6
    }
}
